<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<canvas id="paper" width="0" height="0"></canvas>

<script>
    function loadImage(src) {
        const img = new Image()
        img.crossOrigin = 'anonymous'
        return new Promise((resolve, reject) => {
            img.onload = function () {
                resolve(img)
            }
            img.src = src
        })
    }

    const canvas = document.getElementById('paper')

    const context = canvas.getContext('2d')
    (async function() {
       const img = await loadImage('https://donations-1305256095.cos.ap-nanjing.myqcloud.com/nichousha_9912F58CFA7610C7D3862FC31B7E3461.png')
       const { width, height } = img
       canvas.width = width
       canvas.height = height
        context.drawImage(img, 0,0 )
    }())
</script>
</body>
</html>
